home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / audio / rock / aiff.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  2.0 KB  |  81 lines

  1. /*
  2.  * Copyright (C) 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17. /*
  18.  * AIFF format header file
  19.  *
  20.  * bytes are stored in 68000 = big endian order
  21.  */ 
  22.  
  23. /*
  24.  * some of the audio parameters in an AIFF file
  25.  */
  26. typedef struct
  27. {
  28.     long samprate;
  29.     long nchannels;
  30.     long sampwidth;
  31. } audio_params_t;
  32.  
  33. /*
  34.  * all chunks consist of a chunk header followed by some data
  35.  */
  36. typedef struct
  37. {
  38.     char id[4];
  39.     long size;
  40. } chunk_header_t;
  41.  
  42. #define CHUNK_ID     4
  43. #define CHUNK_HEADER 8
  44.  
  45. typedef struct
  46. {
  47.     chunk_header_t header;
  48.     int file_position;  /* not in AIFF file */
  49.     char type[4]; /* should contain 'AIFF' for any audio IFF file */
  50. } form_chunk_t;
  51.  
  52. #define FORM_CHUNK      12  /* including the header */ 
  53. #define FORM_CHUNK_DATA 4   
  54.  
  55. #define COMM_CHUNK      26   /* including the header */
  56. #define COMM_CHUNK_DATA 18
  57.  
  58. typedef struct
  59. {
  60.     chunk_header_t header;
  61.     int file_position;            /* not in AIFF file */
  62.     short nchannels;
  63.     unsigned long nsampframes;
  64.     short sampwidth;
  65.     long samprate;              /* not in AIFF file */
  66. } comm_chunk_t;
  67.  
  68.  
  69. #define SSND_CHUNK      16   /* including the header */
  70. #define SSND_CHUNK_DATA 8
  71.  
  72. typedef struct
  73. {
  74.     chunk_header_t header;
  75.     unsigned long offset;
  76.     unsigned long blocksize;
  77.  
  78.     long file_position; /* not in AIFF file */
  79.     long sample_bytes; /* not in AIFF file */
  80. } ssnd_chunk_t;
  81.